﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using Team4Mock.DAO;

namespace Team4Mock.Entity
{
    public class ProgrammeEntity
    {
        ProgrammeDAO _dao = new ProgrammeDAO();

        //private int programId;
        //private string programName;
        //private string description;
        //private int contact;
        //private string keyWord;
        //private int isActive;

        public ProgrammeEntity()
        {
            
        }

        public int ProgramId { get; set; }
        public string ProgramName { get; set; }
        public string Description { get; set; }
        public int Contact { get; set; }
        public string KeyWord { get; set; }
        public int IsActive { get; set; }

        public DataTable GetData()
        {
            return _dao.GetData();
        }
        public DataTable GetDataTrue()
        {
            return _dao.GetTrue();
        }

        public DataTable GetById(ProgrammeEntity programme)
        {
            return _dao.GetById(programme.ProgramId);
        }
        public void InsertData(ProgrammeEntity entity)
        {
            _dao.InsertData(entity.ProgramName, entity.Description, entity.Contact, entity.IsActive);
        }
        public void UpdateData(ProgrammeEntity entity)
        {
            _dao.UpdatetData(entity.ProgramId, entity.ProgramName, entity.Description, entity.Contact,entity.IsActive);

        }
        public DataTable Search(ProgrammeEntity programme)
        {
            return _dao.Search(programme.KeyWord);
        }
        public void Del(ProgrammeEntity p)
        {
            _dao.Del(p.ProgramId);
        }
    }
}